import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

public class BottomPanel extends JPanel{
	private static final long serialVersionUID = 1L;
	
	String cardsArray[] = new String[5]; 
	String suitArray[] = new String[5];
	
	public BottomPanel() {
		super();

		JPanel BottomPanel = new JPanel();
		BottomPanel.setLayout(null);
		
		//Sets hand with cards
		JPanel Hand = new JPanel();
		Hand.setLayout(new GridLayout());
		
		final JPanel Card1 = new JPanel();
		JLabel Card1Numt = new JLabel();
		JLabel Card1Numb = new JLabel();
		JLabel Card1Suit = new JLabel();
		Card1.setLayout(new BorderLayout());
		Card1.add(Card1Numt, BorderLayout.NORTH);
		Card1.add(Card1Numb, BorderLayout.SOUTH);
		Card1.add(Card1Suit, BorderLayout.CENTER);
		
		JPanel Card2 = new JPanel();
		JLabel Card2Num = new JLabel();
		JLabel Card2Suit = new JLabel();
		Card2.setLayout(new BorderLayout());
		Card2.add(Card2Suit, BorderLayout.CENTER);
		Card1.add(Card2Num, BorderLayout.NORTH);
		Card2.add(Card2Num, BorderLayout.SOUTH);
		
		JPanel Card3 = new JPanel();
		JLabel Card3Num = new JLabel();
		JLabel Card3Suit = new JLabel();
		Card3.setLayout(new BorderLayout());
		Card3.add(Card3Suit, BorderLayout.CENTER);
		Card1.add(Card3Num, BorderLayout.NORTH);
		Card3.add(Card3Num, BorderLayout.SOUTH);
		
		JPanel Card4 = new JPanel();
		JLabel Card4Num = new JLabel();
		JLabel Card4Suit = new JLabel();
		Card4.setLayout(new BorderLayout());
		Card4.add(Card4Suit, BorderLayout.CENTER);
		Card1.add(Card4Num, BorderLayout.NORTH);
		Card4.add(Card4Num, BorderLayout.SOUTH);
		
		JPanel Card5 = new JPanel();
		JLabel Card5Num = new JLabel();
		JLabel Card5Suit = new JLabel();
		Card5.setLayout(new BorderLayout());
		Card5.add(Card5Suit, BorderLayout.CENTER);
		Card1.add(Card5Num, BorderLayout.NORTH);
		Card5.add(Card5Num, BorderLayout.SOUTH);
		
		Hand.add(Card1);
		Hand.add(Card2);
		Hand.add(Card3);
		Hand.add(Card4);
		Hand.add(Card5);
		
		//Sets Buttons
		JButton Discard = new JButton();
		Discard.setText("Discard");
		
		JButton Fold = new JButton();
		Fold.setText("Fold");
		
		JButton Bid = new JButton();
		Bid.setText("Bid");
		
		JLabel MinbidLabel = new JLabel();
		MinbidLabel.setText("Min Bid");
		
		JLabel MinBid = new JLabel();
		MinBid.setText("Money");
		
		JTextField BidAmount = new JTextField();
		
		//Adds components to panel
		BottomPanel.add(Hand);
		BottomPanel.add(Discard);
		BottomPanel.add(Fold);
		BottomPanel.add(Bid);
		BottomPanel.add(MinbidLabel);
		BottomPanel.add(MinBid);
		BottomPanel.add(BidAmount);
		
		//Sets component bounds
		Hand.setBounds(20,70,610,185);
		Discard.setBounds(15,5,80,25);
		Fold.setBounds(720,230,65,25);
		Bid.setBounds(new Rectangle(new Point(735,5), Bid.getPreferredSize()));
		MinbidLabel.setBounds(new Rectangle(new Point(315,5), Bid.getPreferredSize()));
		MinBid.setBounds(new Rectangle(new Point(360,5), Bid.getPreferredSize()));
		BidAmount.setBounds(675,5,55,25);
		
		//Panel Preferences
		BottomPanel.setPreferredSize(new Dimension(800,300));
		BottomPanel.setMinimumSize(new Dimension(800,300));
		BottomPanel.setMaximumSize(new Dimension(1920,600));
		BottomPanel.setBorder(BorderFactory.createLineBorder(Color.black));
		BottomPanel.setBackground(Color.green);
		
		add(BottomPanel);
		setPreferredSize(new Dimension(800,300));
		setMaximumSize(new Dimension(1920,600));
		
		//Action Handler
		Fold.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				fold();
			}
		});
		
		Discard.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				discard();
			}
		});
		
		Fold.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				fold();
			}
		});
		
		Bid.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				bid();
			}
		});
		
	}
	
	
	
	private void fold(){
		//function for folding
	}
	
	private void discard(){
		//function for folding
	}
	
	private void bid(){
		//function for folding
	}

}
